import Vue from 'vue'
import App from './App.vue'
import { sync } from 'vuex-router-sync';
//import router from "./router/index";
import {createRouter} from "./router/index";
//import store from './vuex/vuex.js';
import {createStore} from "./vuex/vuex";



export  function createApp (context) {
  // const app = new Vue({
  //   // 根实例简单的渲染应用程序组件。
  //   render: h => h(App)
  // })
  var store=createStore();
  var router=createRouter(context,store);
  
  sync(store, router)
  const vueapp=Vue.extend(App);
  const app=new vueapp({
    router,store
  })
  // 创建应用程序实例，将 router 和 store 注入
  // const app = new Vue({
  //   router,
  //   store,
  //   render: h => h(App)
  // })
  return { app,router,store }
}